#ifndef SETTINGSWIZARD_H
#define SETTINGSWIZARD_H

#include <QWizard>
#include <QLabel>
#include <QLineEdit>
#include <QGridLayout>
#include <QHBoxLayout>
#include <QMessageBox>
#include <QPushButton>
#include <QFileDialog>
#include <QSettings>

class SettingsWizard : public QWizard
{
    Q_OBJECT
public:
    enum { Page_CreateDatabase, Page_CreateGameLocation };

    ///
    /// Initialiaze the wizard
    SettingsWizard(QWidget *parent = 0);

    ///
    /// Triggers the accept the wizard to finish the dialog
    void accept();

    ///
    /// @return     The path to the database
    ///
    /// Returns the absolute path to the database
    QString databasePath() const;

private slots:
    ///
    /// Shows the help message of the wizard i.g hints
    void showHelp();
};

class CreateDatabasePage : public QWizardPage
{
    Q_OBJECT
public:
    ///
    /// Initialize the database wizard page
    CreateDatabasePage(QWidget *parent = 0);

    ///
    /// @return     The id of the next wizard page
    ///
    /// Returns the id of the next wizard page
    int nextId() const;

private slots:
    ///
    /// A event to update the database path in the configuration ini file
    void updateDbFilePath();

private:
    QLabel *topLabel_;                          ///< Holds the top label of the wizard
    QLabel *databaseFileLabel_;                 ///< The label for the database file field
    QLineEdit *databaseFileLineEdit_;           ///< Line edit element to show the path
    QPushButton *dataBaseFileButton_;           ///< The choose directory button
};

class CreateGameLocationPage : public QWizardPage
{
    Q_OBJECT
public:
    ///
    /// Initialize the game location wizard page
    CreateGameLocationPage(QWidget *parent = 0);

    ///
    /// @return     The id of the next wizard page
    ///
    /// Returns the id of the next wizard page
    int nextId() const;

private slots:
    ///
    /// A event to update the game location path in the configuration ini file
    void updateGameLocationPath();

private:
    QLabel *topLabel_;                          ///< Holds the top label of the wizard
    QLabel *locationLabel_;                 ///< The label for the game location folder field
    QLineEdit *gameLocationLineEdit_;           ///< Line edit element to show the path
    QPushButton *gameLocationButton_;           ///< The choose directory button
};

#endif // SETTINGSWIZARD_H
